home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
001
/
pibt3sp1.arc
/
GETSCRIP.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1985-09-11
|
7KB
|
184 lines
(*----------------------------------------------------------------------*)
(* Get_Script_Command --- Get command from script buffer *)
(*----------------------------------------------------------------------*)
PROCEDURE Get_Script_Command( VAR Command : PibTerm_Command_Type );
(*----------------------------------------------------------------------*)
(* *)
(* Procedure: Get_Script_Command *)
(* *)
(* Purpose: Get command from script buffer *)
(* *)
(* Calling Sequence: *)
(* *)
(* Get_Script_Command( VAR Command : PibTerm_Command_Type ); *)
(* *)
(* Command --- command extracted from buffer *)
(* *)
(*----------------------------------------------------------------------*)
VAR
L: INTEGER;
(*----------------------------------------------------------------------*)
(* Copy_Script_String --- Copy a string from the script buffer *)
(*----------------------------------------------------------------------*)
PROCEDURE Copy_Script_String( VAR S: AnyStr );
VAR
I: INTEGER;
BEGIN (* Copy_Script_String *)
S := '';
Script_Buffer_Pos := Script_Buffer_Pos + 1;
L := Script_Buffer^[Script_Buffer_Pos];
FOR I := 1 TO L DO
BEGIN
Script_Buffer_Pos := Script_Buffer_Pos + 1;
S := S + CHR( Script_Buffer^[Script_Buffer_Pos] );
END;
END (* Copy_Script_String *);
(*----------------------------------------------------------------------*)
(* Copy_Script_Integer --- Copy an integer from the script buffer *)
(*----------------------------------------------------------------------*)
PROCEDURE Copy_Script_Integer( VAR IntVal: INTEGER );
VAR
Int_Bytes : ARRAY[1..2] OF BYTE ABSOLUTE IntVal;
BEGIN (* Copy_Script_Integer *)
Int_Bytes[1] := Script_Buffer^[Script_Buffer_Pos + 1 ];
Int_Bytes[2] := Script_Buffer^[Script_Buffer_Pos + 2 ];
Script_Buffer_Pos := Script_Buffer_Pos + 2;
END (* Copy_Script_Integer *);
(*----------------------------------------------------------------------*)
BEGIN (* Get_Script_Command *)
(* Check for suspended script *)
(* and exit if suspension still *)
(* in progress. *)
IF Script_Suspend_Time > 0.0 THEN
IF ( TimeDiffH( Script_Suspend_Start, TimeOfDayH ) >
Script_Suspend_Time ) THEN
BEGIN
Command := Null_Command;
EXIT;
END
ELSE
Script_Suspend_Time := 0.0;
(* Set script strings to null *)
Script_String := '';
Script_String_2 := '';
Script_Integer_1 := 0;
(* Point to next command in buffer *)
Script_Buffer_Pos := Script_Buffer_Pos + 1;
(* Pick up command type *)
Command := PibTerm_Command_Table_2[ Script_Buffer^[Script_Buffer_Pos] ];
(* For commands with arguments, *)
(* get the arguments. *)
CASE Command OF
DelaySy : BEGIN
Copy_Script_Integer( Script_Integer_1 );
Delay_Time := Script_Integer_1 * 100;
END;
SuspendSy : BEGIN
Copy_Script_Integer( Script_Integer_1 );
Script_Suspend_Time := Script_Integer_1;
Script_Suspend_Time := Script_Suspend_Time / 10.0;
Script_Suspend_Start := TimeOfDayH;
END;
CaptureSy,
DialSy,
DosSy,
InputSy,
KeySy,
MessageSy,
RedialSy,
STextSy,
TextSy,
TranslateSy,
WaitSy : Copy_Script_String( Script_String );
FileSy : BEGIN
Copy_Script_Integer( Script_Integer_1 );
Copy_Script_String ( Script_String );
Copy_Script_String ( Script_String_2 );
END;
RInputSy : BEGIN
Copy_Script_String ( Script_String );
Copy_Script_Integer( Script_Integer_1 );
END;
IfConSy,
IfFoundSy : BEGIN
Copy_Script_Integer( Script_Integer_1 );
Copy_Script_Integer( Script_Integer_2 );
Copy_Script_Integer( Script_Integer_3 );
END;
IfRemStrSy,
IfLocStrSy : BEGIN
Copy_Script_Integer( Script_Integer_1 );
Copy_Script_Integer( Script_Integer_2 );
Copy_Script_Integer( Script_Integer_3 );
Copy_Script_String ( Script_String );
END;
KeySendSy : BEGIN
Script_Buffer_Pos := Script_Buffer_Pos + 1;
Key_No := Script_Buffer^[Script_Buffer_Pos];
END;
GoToSy : Copy_Script_Integer( Script_Integer_1 );
WaitStrSy : BEGIN
Copy_Script_String ( Script_String );
Copy_Script_String ( Script_String_2 );
Copy_Script_Integer( Script_Integer_1 );
Copy_Script_Integer( Script_Integer_2 );
END;
WhenSy : BEGIN
Copy_Script_String( Script_String );
Copy_Script_String( Script_String_2 );
END;
ReceiveSy : BEGIN
Copy_Script_String ( Script_String );
Copy_Script_Integer( Script_Integer_1 );
END;
SendSy : BEGIN
Copy_Script_String ( Script_String );
Copy_Script_Integer( Script_Integer_1 );
END;
ELSE;
END (* CASE *);
END (* Get_Script_Command *);